package cn.tedu.jsd2207csmallpassport.service.impl;

import cn.tedu.jsd2207csmallpassport.mapper.RoleMapper;
import cn.tedu.jsd2207csmallpassport.pojo.vo.AdminListItemVO;
import cn.tedu.jsd2207csmallpassport.pojo.vo.RoleListItemVO;
import cn.tedu.jsd2207csmallpassport.service.IAdminService;
import cn.tedu.jsd2207csmallpassport.service.IRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Iterator;
import java.util.List;

@Slf4j
@Service
public class RoleServiceImpl implements IRoleService {
    @Autowired
    RoleMapper mapper;

    @Override
    public List<RoleListItemVO> list() {
        log.info("开始处理[查询管理员列表]的业务,无参数");
        List<RoleListItemVO> list =mapper.list();
        Iterator<RoleListItemVO> iterator = list.iterator();
        while (iterator.hasNext()){
            RoleListItemVO item =iterator.next();
            if (item.getId() ==1){
                iterator.remove();
                break;
            }
        }
        return list;
    }
}
